export default function ({ $axios, redirect,store}) {
	/**
	if(process.server){
		// 获取服务端的token
		var token = getCookie.getcookiesInServer(req).token;
	}
	if(process.client){
		// 获取客户端token
		var token = getCookie.getcookiesInClient('token');
	}
	**/
	$axios.onRequest(config => {
		var token = store.state.token;
		// 将获取到token加入到请求头中
		config.headers.common['x-token'] = token;
	});
	$axios.interceptors.response.use( response => {
		return response.data
	},error => {
		return Promise.reject(error.response) 
	})
}